package com.tigase.serviceImpl;

import com.tigase.bean.User;
import com.tigase.dao.UserMapper;
import com.tigase.service.UserMapperService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by Mer on 2017/7/18.
 */
@Service
public class UserMapperImpl implements UserMapperService {
    private final UserMapper UserMapper;

    @Autowired
    public UserMapperImpl(UserMapper UserMapper) {
        this.UserMapper = UserMapper;
    }

    @Override
    public User findByName(String name) {
        return UserMapper.findByName(name);

    }

    @Override
    public int insert(String name, Integer age) {
        return UserMapper.insert(name,age);
    }

    @Override
    public void update(User user) {
        UserMapper.update(user);
    }

    @Override
    public void delete(int id) {
        UserMapper.delete(id);
    }
}
